
Partial Class AddComment
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not HttpContext.Current.User.Identity.IsAuthenticated) Then
            Server.Transfer("~/AccessDenied.aspx")
        End If
    End Sub
    Protected Sub btnSubmitComment_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitComment.Click
        Dim comment As New CommentObj
        comment.CommDate = Date.Now
        comment.ArticleID = CInt(Me.Request.QueryString("ArticleID"))
        comment.Approved = True
        comment.Text = txtCommentBody.Text
        comment.UserID = HttpContext.Current.Profile.UserName
        comment.CommentID = comment.GetNextID
        comment.CreateComment(comment)
        lblFeedback.Visible = True
        Response.Redirect("~/ReadComments.aspx?ArticleID=" & comment.ArticleID)
    End Sub
End Class
